<?xml version="1.0"?>
<!--
    ***** BEGIN LICENSE BLOCK *****
    
    Copyright © 2023 Corporation for Digital Scholarship
                     Vienna, Virginia, USA
					http://zotero.org
    
    This file is part of Zotero.
    
    Zotero is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    
    Zotero is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.
    
    You should have received a copy of the GNU Affero General Public License
    along with Zotero.  If not, see <http://www.gnu.org/licenses/>.
    
    
    ***** END LICENSE BLOCK *****
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://zotero/skin/zotero.css" type="text/css"?>
<?xml-stylesheet href="chrome://zotero/skin/overlay.css" type="text/css"?>
<?xml-stylesheet href="chrome://zotero-platform/content/overlay.css" type="text/css"?>
<?xml-stylesheet href="chrome://zotero-platform/content/zotero.css"?>
<?xml-stylesheet href="chrome://zotero/skin/integration.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">

<xul:window
	id="zotero-citation-explorer-dialog"
	orient="vertical"
	title="Citation Explorer"
	width="750" height="450"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
	persist="screenX screenY width height"
	resizable="true">
<xul:dialog
	buttons="accept" buttonpack="end">

	<script>
		var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");

		Services.scriptloader.loadSubScript("chrome://zotero/content/include.js", this);
		Services.scriptloader.loadSubScript("chrome://zotero/content/customElements.js", this);

		Services.scriptloader.loadSubScript("chrome://zotero/content/integration/citationExplorer.js", this);

	</script>
	<div class="vbox flex xul-border-div">
		<div class="hbox flex">
			<div class="vbox flex">
				<div id="citations-label">Citations</div>
				<div class="vbox flex panel" style="border-right: none">
					<xul:search-textbox id="citation-search" class="search-box" timeout="250" oncommand="ZoteroDocumentCitations.onCitationFilter()" dir="reverse"/>
					<div id="citation-list-container" class="virtualized-table-container">
						<div id="citation-list"></div>
					</div>
					<div class="hbox button-container">
						<input type="button" id="button-show-in-document" value="Show in Document"/>
						<input type="button" id="button-edit-citation" value="Edit Citation"/>
					</div>
				</div>
			</div>
			<div class="splitter"></div>
			<div class="vbox flex">
				<xul:tabbox onselect="ZoteroDocumentCitations.onSelectTab(this.selectedIndex)">
					<xul:tabs>
						<xul:tab id="tab-cited-items" label="Cited Items"/>
						<xul:tab id="tab-uncited-items" label="Uncited Items"/>
					</xul:tabs>
					<!--We are making our own tabpanel UI, but the onselect event above won't fire without these-->
					<xul:tabpanels hidden="true"><xul:tabpanel/><xul:tabpanel/></xul:tabpanels>
				</xul:tabbox>
				<div id="items-panel" class="vbox flex panel">
					<xul:search-textbox id="item-search" class="search-box" timeout="250" oncommand="ZoteroDocumentCitations.onItemFilter()" dir="reverse"/>
					<div id="item-list-container" class="virtualized-table-container">
						<div id="item-list"></div>
					</div>
					<div class="hbox button-container">
						<input type="button" id="button-show-in-zotero" value="Show in Zotero"/>
						<input type="button" id="button-relink-item" value="Relink Item" hidden="true"/>
						<button is="split-menu-button" id="button-addTo-library"
									 onclick="ZoteroDocumentCitations.addToLibraryAndLink()"
									 popup="item-addTo-menu" style="display: none"/>
						<xul:popupset>
							<xul:menupopup id="item-addTo-menu" onpopupshowing="ZoteroDocumentCitations.buildAddToLibraryContextMenu(event);"/>
						</xul:popupset>
					</div>
				</div>
			</div>
		</div>
	</div>
</xul:dialog>
</xul:window>
